﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.OleDb;
using System.Data;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace _4DJackPot
{
    public class Global
    {
        [DllImport("kernel32")]
        public static extern void GetLocalTime(ref SYSTEMTIME lpSystemTime);

        public struct SYSTEMTIME
        {
            public ushort wYear;
            public ushort wMonth;
            public ushort wDayOfWeek;
            public ushort wDay;
            public ushort wHour;
            public ushort wMinute;
            public ushort wSecond;
            public ushort mMilliseconds;
        }

        public static string idString = "";
        public static string pwString = "";
        public static string nameString = "";
        public static string permissionString = "";//permission
        public static string groupIdString = "";

        public static ToolStrip toolStrip = null;

        public static OleDbConnection dBCon = null;       // DB 연결 객체
        public static OleDbCommand dBCmd = null;          // DB 명령 객체
        public static OleDbTransaction dBTrans = null;    // DB 트랜잭션 객체
        public static OleDbDataAdapter dBAdapter = null;  // Query 데이터가 저장될 객체
        public static DataSet dBDataSet = null;

        public static int dbType = -1;                    // MS Access, MS Sql, Oracle
        // MS ACCESS
        public static string dbFileString = "";
        // MS SQL
        public static string dbServerAddrString = "";
        public static string dbNameString = "";
        public static string dbUidString = "";
        public static string dbPidString = "";

        public static SYSTEMTIME currLocalTime;

        public static int companyCreateGameFutureRange = 30;
        public static System.DayOfWeek[] companyCreateGameDayOfWeek = { System.DayOfWeek.Sunday, System.DayOfWeek.Monday, System.DayOfWeek.Wednesday, System.DayOfWeek.Saturday };

        public static void SetCurrTime()
        {
            currLocalTime = new SYSTEMTIME();
            GetLocalTime(ref currLocalTime);
        }

        public static SYSTEMTIME GetCurrTime()
        {
            SYSTEMTIME lt = new SYSTEMTIME();
            GetLocalTime(ref lt);

            return lt;
        }

        public static TreeView tV_menu = new TreeView();
        public static TreeView tV_pgm = new TreeView();
        /*
        public static SPCMain sPCMain = new SPCMain();
        public static SPCMenu sPCMenu = new SPCMenu();
        */
        public static string activatedForm = "";
    }
}
